package be.vdab.winkel;

import java.util.Iterator;
import java.util.Map;

public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Catalogus catalogus = new Catalogus();
		Mandje mand = new Mandje();
		Iterator<Product> i = catalogus.getIterator();
		int y = 1;
		while(i.hasNext()){
			Product p = i.next();
			if(p.getOmschrijving().contains("o")){
				mand.add(p, y++);
			}
		}
		
		System.out.printf("totale kost = %.2f\n",mand.getSom());

		Iterator<Map.Entry<Product,Integer>> i2 = mand.getIterator();
		while(i2.hasNext()){
			Map.Entry<Product,Integer> eo = i2.next();
			System.out.printf("%s %d\n",eo.getKey().getOmschrijving(),eo.getValue());
			}
		}
		
}
